package com.example.demo.config;

import com.example.demo.service.IMCosService;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(IMProperties.class)
public class IMAutoConfiguration {

    @Bean
    public IMOperations imOperations(IMProperties imProperties, IMCosService cosService) {
        return new IMOperations(imProperties.getSdkAppId(), imProperties.getSecret(), cosService);
    }

    @Bean
    public IMCommandParameters imCommandParameters() {
        return new IMCommandParameters();
    }

}
